require "import"
import "android.content.Intent"
import "android.content.pm.PackageManager"
import "android.net.Uri"
import "java.io.File"

function openDownloadFolder()
    local folderPath = "/storage/emulated/0/解说"
    local folderUri = Uri.parse(folderPath)
    -- Crear un intento para abrir el directorio
    local intent = Intent(Intent.ACTION_VIEW)
    intent.setDataAndType(folderUri, "resource/folder")
    intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
    if intent.resolveActivity(service.getPackageManager()) then
        service.startActivity(intent)
    else
        service.asyncSpeak("No se encontró una aplicación para abrir la carpeta.")
    end
end

openDownloadFolder()

-- Línea para hacer que se verbalice el texto con el motor secundario
service.asyncSpeak("carpeta Jieshuo")

require "import"
import "android.content.Context"
import "android.os.Vibrator"

local context = activity or service
local vibrator = context.getSystemService(Context.VIBRATOR_SERVICE)

if vibrator.hasVibrator() then
    vibrator.vibrate(70)
end

return true